package edu.kjxy.worker0308;

import java.util.Scanner;

public class worker02 {

	public static void main(String[] args) {
		System.out.println("请输入一个年份和月份：");
		
		Scanner in = new Scanner(System.in);
		int year = in.nextInt();
		int month = in.nextInt();
		in.close();
		
		switch(month)
		{
		case 1: case 3: case 5: case 7: case 8: case 10: case 12:
			System.out.println("31");
			break;
		case 2:
			if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
			{
				System.out.println("29");
			}
			else
			{
				System.out.println("28");
			}
			break;
		case 4: case 6: case 9: case 11:
			System.out.println("30");
			break;
			default: System.out.println("输入错误！");
		}
	}

}
